package com.legend.ddz.util;

import java.io.IOException;
import java.io.InputStream;

import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

/**
 * 
 * @author zhugh
 * @date 2012-7-9 下午7:59:35
 * @description assets管理
 * 
 */

public class CustomAssetsManage
{
	private static AssetManager assetManager;
	private static InputStream assetFile;

	public CustomAssetsManage(Context context)
	{
		assetManager = context.getResources().getAssets();
	}

	public Bitmap readAssetsSource(String imgName)
	{

		try
		{
			assetFile = assetManager.open(imgName.toString()); 
		} catch (IOException e)
		{
			e.printStackTrace();
		}
		Bitmap bitmap = BitmapFactory.decodeStream(assetFile);

		return bitmap;
	}

}
